﻿<?php
loadview("top");
//loadview("left");
?>
<form action="<?php echo BASE_URL;?>/index.php?module=product&act=edit&id=<?php echo $data['info']['id'];?>" method="post" enctype="multipart/form-data">
<fieldset>
<?php
	if($data['error'] != ""){
		echo "<ul>";
			foreach($data['error'] as $err){
				echo "<li>$err</li>";
			}
		echo "</ul>";
	}
?>
<legend>Add Product</legend>
<label>Sản phẩm</label><input type="text" name="name" placeholder="Tên S/P" value="<?php echo $data['info']['name']?>" />
<br />		
<label>Danh mục</label><select name="category">
						<?php
						foreach($data as $cate)
						{
						echo "<option value={$cate['id']}>{$cate['category']}</option>";
						}
						?>
					   </select>
<br />
<label>Mô tả ngắn</label><br/>
<textarea id="editor2" name="desc" value="<?php echo $data['info']['desc']?>">
</textarea>
<script type="text/javascript">
		//<![CDATA[
			// Replace the <textarea id="editor1"> with an CKEditor instance.
			var editor = CKEDITOR.replace( 'editor2' );
		//]]>
</script>
<label>Hình ảnh 1</label><input type="file" name="image1">
<br/>
<label>Hình ảnh 2</label><input type="file" name="image2">
<br/>
<label>Price</label><input type="text" name="price" placeholder="Giá"  value="<?php echo $data['info']['price']?>"/>
<br/>
<label>price Origin	</label><input type="text" name="price_origin" placeholder="Giá"  value="<?php echo $data['info']['price_origin']?>"/>
<br/>		
<label>Số lượng</label><input type="text" name="quantity"  value="1" value="<?php echo $data['info']['quantity']?>"/>
<br/>
<label>Xuất xứ</label><input type="text" name="origin" value="" placeholder="Xuất xứ"value="<?php echo $data['info']['origin']?>" />
<br/>
<label>Bảo hành</label><input type="text" name="warranty" value="" placeholder="Bảo hành" value="<?php echo $data['info']['warranty']?>" />
<br/>
<label>Status</label>
<input type="radio" name="status" value="Mới">Mới
<input type="radio" name="status" value="98%">98%
<input type="radio" name="status" value="Cũ">Cũ
<br/>
<div style="clear:both;">
</div>
<label>Mô tả</label><br/>
<textarea cols="50" rows="4" id="editor1" name="detail" value="<?php echo $data['info']['detail']?>" >
</textarea>
<script type="text/javascript">
		//<![CDATA[
			// Replace the <textarea id="editor1"> with an CKEditor instance.
			var editor = CKEDITOR.replace( 'editor1' );
		//]]>
</script>
<br/>

<label>Xác nhận</label> <input type="submit" name="ok" value="Submit" />	
</fieldset>
</form>
<?php
loadview("bottom");

?>